package com.salon.server.controller;

import com.salon.server.entity.ProductCategory;
import com.salon.server.model.R;
import com.salon.server.service.ProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/salon/productCategory")
public class ProductCategoryController {

    @Autowired
    private ProductCategoryService productCategoryService;

    @PostMapping("list")
    public R list() {
        return R.success(productCategoryService.list());
    }

    /**
     * update
     */
    @PostMapping("update")
    public R update(@RequestBody ProductCategory productCategory) {
        return R.success(productCategoryService.updateById(productCategory));
    }

}
